<?php
use app\components\BaseDetailView;
use app\components\BaseGridView;
use app\utils\BaseUtils;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model app\models\User */
?>

<?php if($model->getIsVerify()): ?>
    <div class="row box" id="toolbar">
        <div class="col-md-9 col-sm-8 col-xs-7">
            <button href="<?= Url::to(['allow', 'id' => $model->id]); ?>" class="get btn">通过审核</button>
            <button href="<?= Url::to(['deny', 'id' => $model->id]); ?>" class="deny btn danger batch-delete">审核拒绝</button>
        </div>
    </div>
<?php endif; ?>

<?= BaseDetailView::widget([
    'model' => $model,
    'firstWidth' => '17%',
    'attributes' => [
        [
            'attribute' => 'avatar',
            'visible' => !empty($model->getAvatar()),
            'value' => Html::img($model->getAvatar(), ['class' => 'user-avatar']),
            'template' => '<tr><td colspan="2" class="text-left">{value}</td></tr>',
            'format' => 'raw'
        ],
        ['attribute' => 'uname', 'label' => '企业名称'],
        'phone',
        ['label' => '规模', 'value' => $model->profile->company_scale],
        ['label' => '行业', 'value' => $model->profile->industry],
        ['label' => '邮箱', 'value' => $model->profile->email],
        ['label' => '地址', 'value' => $model->profile->address],
        ['label' => '基本信息', 'value' => $model->profile->experience1],
        ['label' => '副本照片', 'format' => 'raw', 'value' => BaseUtils::arrayToImage($model->profile->getThumbsByFiled('identity_images'))],
        ['label' => '负责人证明', 'format' => 'raw', 'value' => BaseUtils::arrayToImage($model->profile->getThumbsByFiled('user_images'))],
        ['label' => '风貌展示', 'format' => 'raw', 'value' => BaseUtils::arrayToImage($model->profile->getThumbsByFiled('style_images'))],
        ['label' => '产品展示', 'format' => 'raw', 'value' => BaseUtils::arrayToImage($model->profile->getThumbsByFiled('product_images'))],
        ['label' => '官网链接', 'value' => $model->profile->home_link],
        ['label' => '审核拒绝原因', 'visible' => $model->getIsVerifyDeny(), 'value' => $model->remark],

        'ctime:datetime'
    ],
]); ?>